<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionParameter 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionobject.export.html">ReflectionObject::export</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionparameter.allowsnull.html">ReflectionParameter::allowsNull</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.reflectionparameter" class="reference">

 <h1 class="title">ReflectionParameter 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5)</p>


  <div class="section" id="reflectionparameter.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <strong class="classname">ReflectionParameter</strong> 取回了函数或方法参数的相关信息。
   </p>
   <p class="para">
    要自行检查函数的参数，首先创建一个 <a href="class.reflectionfunction.html" class="classname">ReflectionFunction</a> 或 <a href="class.reflectionmethod.html" class="classname">ReflectionMethod</a> 的实例，然后使用它们的 <span class="methodname"><a href="reflectionfunctionabstract.getparameters.html" class="methodname">ReflectionFunctionAbstract::getParameters()</a></span> 方法来获取参数的数组。
   </p>
  </div>


  <div class="section" id="reflectionparameter.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">ReflectionParameter</strong>
     </span>
     
     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.reflector.html" class="interfacename">Reflector</a></span>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.reflectionparameter.html#reflectionparameter.props.name">$<var class="varname">name</var></a></var>
    ;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.allowsnull.html" class="methodname">allowsNull</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.canbepassedbyvalue.html" class="methodname">canBePassedByValue</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="reflectionparameter.clone.html" class="methodname">__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionparameter.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$function</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$parameter</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span><span class="methodname"><a href="reflectionparameter.export.html" class="methodname">export</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$function</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$parameter</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$return</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionClass</span><span class="methodname"><a href="reflectionparameter.getclass.html" class="methodname">getClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionClass</span><span class="methodname"><a href="reflectionparameter.getdeclaringclass.html" class="methodname">getDeclaringClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionFunctionAbstract</span><span class="methodname"><a href="reflectionparameter.getdeclaringfunction.html" class="methodname">getDeclaringFunction</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionparameter.getdefaultvalue.html" class="methodname">getDefaultValue</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionparameter.getdefaultvalueconstantname.html" class="methodname">getDefaultValueConstantName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionparameter.getname.html" class="methodname">getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionparameter.getposition.html" class="methodname">getPosition</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.isarray.html" class="methodname">isArray</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.iscallable.html" class="methodname">isCallable</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.isdefaultvalueavailable.html" class="methodname">isDefaultValueAvailable</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.isdefaultvalueconstant.html" class="methodname">isDefaultValueConstant</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.isoptional.html" class="methodname">isOptional</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionparameter.ispassedbyreference.html" class="methodname">isPassedByReference</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionparameter.tostring.html" class="methodname">__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>


  </div>

  

  <div class="section" id="reflectionparameter.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="reflectionparameter.props.name"><var class="varname"><var class="varname">name</var></var></dt>

     <dd>

      <p class="para">
       参数的名称。只读，在尝试赋值的时候会抛出 <a href="class.reflectionexception.html" class="classname">ReflectionException</a>。
      </p>
     </dd>

    
   </dl>

  </div>



 </div>

 






































































































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionparameter.allowsnull.html">ReflectionParameter::allowsNull</a> — Checks if null is allowed</li><li><a href="reflectionparameter.canbepassedbyvalue.html">ReflectionParameter::canBePassedByValue</a> — Returns whether this parameter can be passed by value</li><li><a href="reflectionparameter.clone.html">ReflectionParameter::__clone</a> — Clone</li><li><a href="reflectionparameter.construct.html">ReflectionParameter::__construct</a> — Construct</li><li><a href="reflectionparameter.export.html">ReflectionParameter::export</a> — Exports</li><li><a href="reflectionparameter.getclass.html">ReflectionParameter::getClass</a> — Get the type hinted class</li><li><a href="reflectionparameter.getdeclaringclass.html">ReflectionParameter::getDeclaringClass</a> — Gets declaring class</li><li><a href="reflectionparameter.getdeclaringfunction.html">ReflectionParameter::getDeclaringFunction</a> — Gets declaring function</li><li><a href="reflectionparameter.getdefaultvalue.html">ReflectionParameter::getDefaultValue</a> — Gets default parameter value</li><li><a href="reflectionparameter.getdefaultvalueconstantname.html">ReflectionParameter::getDefaultValueConstantName</a> — Returns the default value's constant name if default value is constant or null</li><li><a href="reflectionparameter.getname.html">ReflectionParameter::getName</a> — Gets parameter name</li><li><a href="reflectionparameter.getposition.html">ReflectionParameter::getPosition</a> — Gets parameter position</li><li><a href="reflectionparameter.isarray.html">ReflectionParameter::isArray</a> — Checks if parameter expects an array</li><li><a href="reflectionparameter.iscallable.html">ReflectionParameter::isCallable</a> — Returns whether parameter MUST be callable</li><li><a href="reflectionparameter.isdefaultvalueavailable.html">ReflectionParameter::isDefaultValueAvailable</a> — Checks if a default value is available</li><li><a href="reflectionparameter.isdefaultvalueconstant.html">ReflectionParameter::isDefaultValueConstant</a> — Returns whether the default value of this parameter is constant</li><li><a href="reflectionparameter.isoptional.html">ReflectionParameter::isOptional</a> — Checks if optional</li><li><a href="reflectionparameter.ispassedbyreference.html">ReflectionParameter::isPassedByReference</a> — Checks if passed by reference</li><li><a href="reflectionparameter.tostring.html">ReflectionParameter::__toString</a> — To string</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionobject.export.html">ReflectionObject::export</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionparameter.allowsnull.html">ReflectionParameter::allowsNull</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
